Learning Objectives

After completing this lesson, you’ll be able to: 

Instructions

In this lesson, you will:

Resources

Reading and Writing Workflows

Many users begin a workspace by adding a single reader and writer. However, you will quickly find yourself needing to add additional readers, writers, or feature types. Additionally, FME can read/write data using:

Multiple Readers and Writers

An FME workspace is not limited to any particular number of readers or writers; readers and writers can be added to a workspace at any time, any number of formats can be used, and there does not need to be an equal number of readers and writers.

For example, the Navigator window below shows that this workspace contains two readers and three writers, each with different formats.

Viewing multiple readers and writers in the Navigator

Note

It's important to note that readers and writers don’t appear as objects on the Workbench canvas. Their feature types do, but readers and writers don't.

Instead, they are represented by entries in the Navigator window, as shown in the screenshot above.

Adding Readers and Writers

Additional readers or writers are added to a translation using the Quick Add menu. You can filter by Source or Destination to filter to readers and writers, respectively. Note that these filters also include transformers that can read or write data.

Adding a reader using the Quick Add menu

You can also add readers and writers from the Build menu:

Adding a reader or writer using the menu

For readers, you can also click and drag a file onto the canvas:

Drag and drop data onto the canvas

All these actions open a dialog in which you can define the parameters for the new reader or writer:

Add Writer dialog

If you use Quick Add or the click-and-drag methods, the Add Reader dialog will automatically fill in the Format parameter. Note that FME will guess the Format based on the file ending when clicking and dragging, so make sure to double-check it. Some reader formats use the same file ending, e.g., GeoJSON and JSON can both use the .json file ending.

You can add as many readers and writers as you require in this way.

Deleting a Reader or Writer

If you no longer need a reader or writer, then you can delete it using the menu bar under Build:

Removing a reader or writer using the menu

Alternatively, it's possible to right-click a reader/writer in the Navigator window and choose the Delete option.

Updating a Reader or Writer

Readers and writers can be updated so that older workspaces have the speed and functionality available in a newer version of FME. You can update a reader/writer by right-clicking the reader/writer in the Navigator window and choosing the Update option:

Updating a reader from the Navigator

This tool provides the option to update the reader or update the list of feature types being read. This way, the workspace can be updated if the source data changes. Another way to update feature types is Reader > Update Feature Types on the menu bar.

Note

Do you want to always read all the feature types in a dataset, even if it changes? You can merge feature types in this case. 

Learn more in Define Schema Dynamically from Incoming Datasets.

Importing Feature Types

The Import Feature Types function adds feature types to an existing dataset by importing the schema from any dataset.

The log will display processing information and the feature types will be added to the selected dataset.

Updating Feature Types

If the structure of the data changes in your workspace (for example, the schema changes or an attribute type changes) you will usually want to keep your workspace up-to-date. This is a particularly useful feature if you are working with databases, or if you are sharing data within a workgroup.

Select Readers > Update Feature Types or Writers > Update Feature Types.

Deleting Feature Types

You can delete feature types by right-clicking them on the Canvas and selecting Delete.

If you delete the last feature type belonging to a reader or writer, FME will ask if you also wish to delete the reader or writer. We recommend doing so unless you plan to add feature types later.

Exercise

Frank

Frank is working on a workspace that reads from the community mapping geodatabase and writes to GML. He needs to make some updates before republishing it to FME Flow to power a self-serve Flow App.

Here are the changes he needs to make:

  1. He's been asked to add support for several new feature types that have been added to the community mapping geodatabase since he created the workspace:
    1. FoodVendors
    2. TransitStations
    3. Parks
  2. He's been asked to add support for writing the parks data to SQLite.

Let's help him out.

1) Open Starting Workspace

Starting workspace

2) Import Reader Feature Types

First, let's add the new reader feature types. 

It's a good idea to add reader feature types first, especially if you plan to duplicate them on one or more writers. Then you can quickly use their schema when adding the new writer feature types.

Build > Readers > Import Feature Types

Import Reader Feature Types dialog

Selecting feature types

New reader feature types

3) Add Parks SQLite Writer

Next, we want to add the SQLite writer.

Adding SQLite writer

Selecting Parks reader feature type to copy

Parks writer feature type added

4) Add Writer Feature Types

Now we'd like to add the new feature types to the existing GML writer.

Build > Writers > Add Feature Type...

Adding FoodVendors

Feature types all connected

Great! The workspace has the correct feature types now.

Next, we'll have a look at configuring the reader and writer parameters.

Leave Us Feedback on This Lesson